//
//  DemoViewController.swift
//  Weibo_Swift_GX
//
//  Created by Tony on 2018/2/9.
//  Copyright © 2018年 Tony. All rights reserved.
//

import UIKit

class DemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"  
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    @objc private func rightItemAction() {
        // 不停地push
        let vc = DemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
    
    /// test
    @objc private func rightItemAction2() {
        let tabBarVc: WBMainViewController = self.tabBarController as! WBMainViewController
        tabBarVc.setVcs()
    }
    
    

    override func setupUI() {
        super.setupUI()
        
        navItem.rightBarButtonItems = [
            UIBarButtonItem(title: "下一个", color: UIColor.blue, target: self, action: #selector(rightItemAction)),
            UIBarButtonItem(title: "切换", color: UIColor.blue, target: self, action: #selector(rightItemAction2))
        ]
    }

}
